<div id="gallery-photos">
    <ul>
        <?php foreach ($galleryItems as $galleryItem): ?>
            <li class="gallery-photo">
                <a class="gallery-item" galleryitem="<?php echo $galleryItem->getId() ?>" href="javascript:;" title="<?php echo $galleryItem->getCaption() ?>">
                    <?php echo image_tag("/uploads/gallery/" .$galleryItem->getId() . "/" . $galleryItem->getPhotoUrl(50), array("alt" => $galleryItem->getCaption(), "height" => "50px")) ?>           
                </a>
            </li>
        <?php endforeach; ?>
    </ul>
</div>